﻿
@{
    ViewBag.Title = "我的任务";
}
<div class="page-bar">
    <ul class="page-breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="@Url.Action("Index","Home")">首页</a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            <a href="@Url.Action("Index", "Task")">我的任务</a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            <a href="#">任务列表</a>
        </li>
    </ul>
</div>
<div class="row" ng-controller="TaskController">
    <div class="col-md-12">
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-star"></i>我的任务
                </div>
                <div class="tools">
                    <a href="javascript:;" class="reload" data-original-title="" title="reload" ng-click="Query()"></a>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-toolbar">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="btn-group">
                                <a href="@Url.Action("Create", "Task")" class="btn green">
                                    创建任务 <i class="fa fa-plus"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>任务名称</th>
                            <th>环境</th>
                            <th>分支</th>
                            <th>状态</th>
                            <th>任务描述</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in items">
                            <td><a  class="text-primary" href="/Task/Detail?taskId={{item.Id}}">{{item.TaskName}}</a> </td>
                            <td>{{item.DeployEnvironment|environmentFilter}}</td>
                            <td>{{item.Branch}}</td>
                            <td>{{item.Status|taskStatusFilter}}</td>
                            <td>{{item.TaskDesc}}</td>
                            <td>
                                <div>
                                    <a class="btn btn-primary editor" ng-show="item.Status==0||item.Status==4||item.Status==10" ng-click="Deploy(item)">编译部署</a>
                                    <a class="btn btn-primary delete" ng-show="item.Status==6" ng-click="CommitToTest(item)">提交测试</a>
                                    <a class="btn btn-primary delete" href="/Task/Logs/{{item.Id}}">任务记录</a>
                                    <a class="btn btn-primary delete" ng-click="ReleaseDomain(item.Id)">释放域名</a>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="pull-right">
                            <uib-pagination total-items="totalItems" ng-model="currentPage" ng-change="Query()" first-text="首页" last-text="末页"
                                            previous-text="上一页" next-text="下一页" items-per-page="pageSize" max-size="5" boundary-links="true" boundary-link-numbers="true" rotate="false"></uib-pagination>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
</div>
@section Scripts {
   <script src="~/app/services/CommonService.js"></script>
    <script src="~/app/services/ProjectService.js"></script>
    <script src="~/app/services/TaskService.js"></script>
    <script src="~/app/filters/CommonFilter.js"></script>
    <script src="~/app/controllers/TaskList.js"></script>
}


